'''
Created on 2011-06-30

@author: Mikael
'''


class Component(object):
    '''
    Represent a component and it's properties
    '''

    def __init__(self, type):
        '''
        Constructor
        '''
        self.mPropertyList = []
        self.mType = type
        
    def AddProperty(self, prop):
        '''
        A a property to the component
        '''
        self.mPropertyList.append(prop)
        
    def RemovePropertyByName(self, name=""):
        '''
        Remove a property by it's name
        '''
        removeList = []
        
        #Build the remove list
        for prop in self.mPropertyList:
            if prop.mName == name:
                removeList.append(prop)
        
        #Remove from the list
        for propToRemove in removeList:
            self.mPropertyList.remove(propToRemove)
